package designPattern.factorPattern.simpleFactorPattern;

/**
 * FruitFactory
 *
 * @author nanxin.chen
 * @date 2015/8/28
 */
public class FruitSimpleFactory {
    public static Fruit getFruit(String type) {
        switch (type) {
            case "apple":
                return new Apple();
            case "orange":
                return new Orange();
            default:
                return new Apple();
        }
    }
}
